package cn.ilikes.tools.nosql.jpa.clients;

import org.apache.hadoop.hbase.client.Result;
import org.slf4j.Logger;

import cn.ilikes.tools.logs.Loggerfactory;
import cn.ilikes.tools.nosql.jpa.JPASQLPersistenUnitEnv;
import cn.ilikes.tools.nosql.jpa.JPASQLRunTimeException;
import cn.ilikes.tools.nosql.jpa.graphs.Node;
import cn.ilikes.tools.nosql.jpa.metadatas.EntityMetaData;

public abstract class ClientBaseImple {

	private JPASQLPersistenUnitEnv persistenUnitEnv;

	public ClientBaseImple(JPASQLPersistenUnitEnv persistenUnitEnv) {
		super();
		this.persistenUnitEnv = persistenUnitEnv;
	}

	public JPASQLPersistenUnitEnv getPersistenUnitEnv() {
		return persistenUnitEnv;
	}

	private Logger logger = Loggerfactory.instance(ClientBaseImple.class);

	public void delete(Node node) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not delete");

	}

	public <V> Node findById(Class<V> clazz, Object key) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not findById");
	}

	public Node save(Node node) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not save");
	}

	public Node update(Node node) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not update");
	}

	public Object findValue(EntityMetaData targetEntityMetaData, Object keyId, Class<?> type, String getfamily, String qualifier) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not update");
	}

	public void close() {
		if (Loggerfactory.isdebug(logger))
			Loggerfactory.debug(logger, " client close ");

	}

	public Node ResultToObject(EntityMetaData entityMetaData, Result result) throws JPASQLClientsException {
		throw new JPASQLRunTimeException("not work ");
	}
}